<?php
/**
 * Created by PhpStorm.
 * User: peter
 * Date: 2018/10/30
 * Time: 10:22 AM
 */

namespace app\activity\controller;


use think\Request;

class Sms extends Base
{
    /**
     * @purpose  找回密码时获取验证码
     * @param Request $request
     * @return array
     */
    public function authCodeForFindPassword (Request $request)
    {
        $mobile     = $request->get('mobile');
        return \app\activity\logic\Sms::authCodeForFindPassword($mobile);
    }
    /**
     * @purpose 绑定时获取手机验证码
     * @param Request $request
     * @return array
     */
    public function bindSmsCode (Request $request)
    {
        $mobile     = $request->get('mobile');
        return  \app\activity\logic\Sms::bindSmsCode($mobile);
    }
    /**
     * @purpose 获取短信验证码
     * @param Request $request
     * @return array
     */
    public function authCode (Request $request)
    {
        $mobile     = $request->get('mobile');
        return \extend\SMS::smsCode($mobile);
    }

    /**
     * @purpose 获取更换号码时的验证码
     * @param Request $request
     * @return array
     */
    public function authCodeForChange (Request $request)
    {
        $mobile     = $request->get('mobile', '');
        return \app\activity\logic\Sms::authCodeForChange($mobile);
    }
}